part of 'card_info.dart';

class RepetitionAnswerSelectionExposedCardInfo extends Equatable implements CardInfo {
  RepetitionAnswerSelectionExposedCardInfo({
    String? cardId,
    required this.lexicalItem,
    required this.safeToPronounce,
    required this.cardActions,
    required this.repeatableLexicalItemCount,
    required this.finishEvent,
    required this.imagePath,
  }) : cardId = cardId ?? UuidGenerator().generateUuid();

  @override
  final String cardId;

  final LexicalItem lexicalItem;
  final bool safeToPronounce;
  final BuiltList<CardAction> cardActions;
  final int repeatableLexicalItemCount;
  final RepetitionAnswerSelectionExposedCardFinishEvent finishEvent;
  final String? imagePath;

  @override
  List<Object?> get props {
    return [
      cardId,
      lexicalItem,
      safeToPronounce,
      cardActions,
      repeatableLexicalItemCount,
      finishEvent,
      imagePath,
    ];
  }

  RepetitionAnswerSelectionExposedCardInfo copyWith({
    String Function()? cardId,
    LexicalItem Function()? lexicalItem,
    bool Function()? safeToPronounce,
    BuiltList<CardAction> Function()? cardActions,
    int Function()? repeatableLexicalItemCount,
    RepetitionAnswerSelectionExposedCardFinishEvent Function()? finishEvent,
    String? Function()? imagePath,
  }) {
    return RepetitionAnswerSelectionExposedCardInfo(
      cardId: cardId == null ? this.cardId : cardId(),
      lexicalItem: lexicalItem == null ? this.lexicalItem : lexicalItem(),
      safeToPronounce: safeToPronounce == null ? this.safeToPronounce : safeToPronounce(),
      cardActions: cardActions == null ? this.cardActions : cardActions(),
      repeatableLexicalItemCount: repeatableLexicalItemCount == null
          ? this.repeatableLexicalItemCount
          : repeatableLexicalItemCount(),
      finishEvent: finishEvent == null ? this.finishEvent : finishEvent(),
      imagePath: imagePath == null ? this.imagePath : imagePath(),
    );
  }
}

enum RepetitionAnswerSelectionExposedCardFinishEvent {
  none,
  markedAsRemembered,
  markedAsBadlyRemembered,
  markedAsUnremembered,
  markedAsCompletelyLearned,
  progressReset,
  excludedFromLearning,
  // deleted,
  vanished;

  bool get isNone {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.none;
  }

  bool get isMarkedAsRemembered {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.markedAsRemembered;
  }

  bool get isMarkedAsBadlyRemembered {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.markedAsBadlyRemembered;
  }

  bool get isMarkedAsUnremembered {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.markedAsUnremembered;
  }

  bool get isMarkedAsCompletelyLearned {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.markedAsCompletelyLearned;
  }

  bool get isProgressReset {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.progressReset;
  }

  bool get isExcludedFromLearning {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.excludedFromLearning;
  }

  bool get isVanished {
    return this == RepetitionAnswerSelectionExposedCardFinishEvent.vanished;
  }

// bool get isDeleted {
//   return this == RepetitionAnswerSelectionExposedCardFinishEvent.deleted;
// }
}
